import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import 'font-awesome/css/font-awesome.min.css' // 确保已安装 font-awesome
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { useUserStore } from '@/stores/user'

// 注册图标（可选）
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
app.use(createPinia()) // 使用 Pinia
app.use(router)
app.use(ElementPlus)



for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')

const userStore = useUserStore()
userStore.init()
